//默认参数
def func1(name: String = "Toms") = "Hello " + name

func1();
func1("Mike");

//代名参数
def func2(str: String = "Good morning", name: String = "Toms", age: Int = 20)
= "Hello " + name + " " + str + " " + age
func2(name = "Mike")


//可变参数
def sum(args: Int*) = {
  var result = 0
  for (arg <- args) result+=arg
  //最后一句话就是返回值
  result
}
sum(1,2,3)
sum(1,2,3,4)
